﻿using GraphProcessor;
using IQIGame.Onigao.Logic;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay.Editors
{
    // [System.Serializable, NodeMenuItem("Custom/SkillEffective")]
    public class SkillEffectiveNode : BaseNode
    {

        [Input("技能Part")] public SkillPartConfig Input;
        [Input("执行顺序"), ShowAsDrawer] public int Index;
        [Output("目标选择", false)]
        protected SkillEffectiveConfig selfConfig;

        public override Color color => Color.gray;
        protected virtual ESkillEffectiveType effectType { get; }

        protected override void Process()
        {
            base.Process();
            var rCustom = this.CreateConfig();
            var rConfig = new SkillEffectiveConfig()
            {
                index = this.Index,
                type = (int)this.effectType,
                customConfig = rCustom,
            };
            this.selfConfig = rConfig;
            this.Input?.effectives.Add(this.selfConfig);
        }

        protected virtual SkillCustomConfig CreateConfig()
        {
            return null;
        }
    }
}